package c.e.a.b.f.b;

import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.util.Pair;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class d4 extends r5 {
    public static final Pair<String, Long> D = new Pair("", Long.valueOf(0));
    public final j4 A = new j4(this, "deferred_attribution_cache");
    public final h4 B = new h4(this, "deferred_attribution_cache_timestamp", 0);
    public final i4 C = new i4(this, "default_event_parameters");
    public SharedPreferences c;
    public k4 d;
    public final h4 e = new h4(this, "last_upload", 0);
    public final h4 f = new h4(this, "last_upload_attempt", 0);
    public final h4 g = new h4(this, "backoff", 0);
    public final h4 h = new h4(this, "last_delete_stale", 0);
    public final h4 i = new h4(this, "midnight_offset", 0);
    public final h4 j = new h4(this, "first_open_time", 0);
    public final h4 k = new h4(this, "app_install_time", 0);
    public final j4 l = new j4(this, "app_instance_id");
    public String m;
    public boolean n;
    public long o;
    public final h4 p = new h4(this, "time_before_start", 10000);
    public final h4 q = new h4(this, "session_timeout", 1800000);
    public final f4 r = new f4(this, "start_new_session", true);
    public final j4 s = new j4(this, "non_personalized_ads");
    public final f4 t = new f4(this, "allow_remote_dynamite", false);
    public final h4 u = new h4(this, "last_pause_time", 0);
    public boolean v;
    public f4 w = new f4(this, "app_backgrounded", false);
    public f4 x = new f4(this, "deep_link_retrieval_complete", false);
    public h4 y = new h4(this, "deep_link_retrieval_attempts", 0);
    public final j4 z = new j4(this, "firebase_feature_rollouts");

    public d4(u4 u4Var) {
        super(u4Var);
    }

    public final void m() {
        SharedPreferences sharedPreferences = this.a.a.getSharedPreferences("com.google.android.gms.measurement.prefs", 0);
        this.c = sharedPreferences;
        String str = "has_been_opened";
        boolean z = sharedPreferences.getBoolean(str, false);
        this.v = z;
        if (!z) {
            Editor edit = this.c.edit();
            edit.putBoolean(str, true);
            edit.apply();
        }
        this.d = new k4(this, "health_monitor", Math.max(0, ((Long) p.c.a(null)).longValue()), null);
    }

    public final boolean r() {
        return true;
    }

    public final void s(Boolean bool) {
        g();
        Editor edit = w().edit();
        String str = "measurement_enabled";
        if (bool != null) {
            edit.putBoolean(str, bool.booleanValue());
        } else {
            edit.remove(str);
        }
        edit.apply();
    }

    public final boolean t(int i) {
        return d.e(i, w().getInt("consent_source", 100));
    }

    public final boolean u(long j) {
        return j - this.q.a() > this.u.a();
    }

    public final void v(boolean z) {
        g();
        d().n.b("App measurement setting deferred collection", Boolean.valueOf(z));
        Editor edit = w().edit();
        edit.putBoolean("deferred_analytics_collection", z);
        edit.apply();
    }

    public final SharedPreferences w() {
        g();
        o();
        return this.c;
    }

    public final Boolean x() {
        g();
        String str = "measurement_enabled";
        return w().contains(str) ? Boolean.valueOf(w().getBoolean(str, true)) : null;
    }

    public final d y() {
        g();
        return d.b(w().getString("consent_settings", "G1"));
    }
}
